const powerset = (arr) =>
  arr.reduce((a, v) => a.concat(a.map((r) => [v].concat(r))), [[]]);
let arr = [[2,3],[4,5]];
console.log(powerset(arr)); // 输出: [[1], [2], [1, 2]]
